package top.ruanlitao.shortlink.project.common.constant;

/**
 * Redis Key 常量类
 */
public class RedisKeyConstant {

    /**
     * 短链接跳转前缀 key
     */
    public static final String GOTO_SHORT_LINK_KEY = "short-link:goto:normal:%s";

    /**
     * 短链接跳转锁前缀
     */
    public static final String LOCK_GOTO_SHORT_LINK_KEY = "short-link:lock:goto:%s";

    /**
     * 短链接跳转空值锁前缀
     */
    public static final String GOTO_NULL_VALUE_SHORT_LINK_KEY = "short-link:goto:null-value:%s";

    /**
     * 短链接统计 UV
     */
    public static final String UV_STATS_SHORT_LINK_KEY = "short-link:stats:uv:%s";

    /**
     * 短链接统计 UV
     */
    public static final String UIP_STATS_SHORT_LINK_KEY = "short-link:stats:uip:%s";

    /**
     * 短链接修改分组 ID 锁前缀 Key
     */
    public static final String LOCK_GID_UPDATE_KEY = "short-link:lock:update-gid:%s";

    /**
     * 短链接延迟队列消费统计 Key
     */
    public static final String DELAY_QUEUE_STATS_KEY = "short-link:stats:delay-queue";

    /**
     * 监控数据消息主题 Key
     */
    public static final String STATS_STREAM_TOPIC_KEY = "short-link:stats-stream";

    /**
     * 监控数据消费者 Key
     */
    public static final String STATS_STREAM_GROUP_KEY = "short-link:stats-stream:only-group";

    /**
     * 创建短链接时的分布式锁 Key
     */
    public static final String LOCK_SHORT_LINK_CREATE_KEY = "short-link:lock:create";

    /**
     * IP 归属地信息缓存 Key
     */
    public static final String IP_PLACE_OF_ORIGIN_KEY = "short-link:ip-place:%s";

    /**
     * 缓存发号 Key
     */
    public static final String GENERATE_ID_KEY = "short-link:id:generate";

    /**
     * 缓存发号锁 Key
     */
    public static final String LOCK_GENERATE_ID_KEY = "short-link:lock:id:generate";
}
